#Lindsay Ergenekan
#ergenekl@onid.oregonstate.edu
#CS311-400
#Homework2- Question4


import getopt, sys, os, numbers

def main(argv): 
   if (str.isdigit(sys.argv[1])):
      prime_wanted = sys.argv[1]
      print "We are looking for the " + prime_wanted + "th prime number"  
      limit = 15
      prime_wanted = int(prime_wanted)
      generatePrimes(2, limit, prime_wanted)

def generatePrimes(start, limit, prime_wanted): 
   list_primes = []
   for i in range(start,limit):
      for a in range(2,i):
         if i % a == 0:
            break
         else:
            if i not in list_primes:
               list_primes.append(i)
   print list_primes
   print list_primes[prime_wanted]
   return list_primes 





if __name__ == "__main__":
   main(sys.argv[1:])
